//@ts-nocheck
const initialState = {
  tel: ''
  ,name: ''
};
import {TYPES} from './action'

export const reducerCreator = (types, initialState) => {
  return (state, action) => {
    const {type, payload} = action;
    if (Object.values(types).includes(type)) return {...state, ...payload};
    return state || initialState;
  }
};

export default reducerCreator(TYPES, initialState);
